.class public Lrexsee/core/widget/Slider;
.super Landroid/widget/LinearLayout;
.source "Slider.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lrexsee/core/widget/Slider$OnSliderChangeListener;
    }
.end annotation


# instance fields
.field private final beginText:Landroid/widget/TextView;

.field private final endText:Landroid/widget/TextView;

.field private final mDensity:F

.field private final seekBar:Landroid/widget/SeekBar;

.field private final seekText:Landroid/widget/TextView;

.field private final titleText:Landroid/widget/TextView;


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;IIILrexsee/core/widget/Slider$OnSliderChangeListener;)V
    .locals 7
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "title"    # Ljava/lang/String;
    .param p3, "begin"    # I
    .param p4, "end"    # I
    .param p5, "init"    # I
    .param p6, "listener"    # Lrexsee/core/widget/Slider$OnSliderChangeListener;

    .prologue
    .line 22
    invoke-direct {p0, p1}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    .line 23
    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    invoke-virtual {v2}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v2

    iget v2, v2, Landroid/util/DisplayMetrics;->density:F

    iput v2, p0, Lrexsee/core/widget/Slider;->mDensity:F

    .line 24
    const/4 v2, 0x0

    invoke-virtual {p0, v2}, Lrexsee/core/widget/Slider;->setOrientation(I)V

    .line 25
    const/16 v2, 0x10

    invoke-virtual {p0, v2}, Lrexsee/core/widget/Slider;->setGravity(I)V

    .line 26
    new-instance v2, Landroid/widget/TextView;

    invoke-direct {v2, p1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    iput-object v2, p0, Lrexsee/core/widget/Slider;->titleText:Landroid/widget/TextView;

    .line 27
    if-eqz p2, :cond_0

    const-string v2, ""

    invoke-virtual {p2, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_0

    .line 28
    iget-object v2, p0, Lrexsee/core/widget/Slider;->titleText:Landroid/widget/TextView;

    const/high16 v3, 0x41900000    # 18.0f

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextSize(F)V

    .line 29
    iget-object v2, p0, Lrexsee/core/widget/Slider;->titleText:Landroid/widget/TextView;

    const/4 v3, 0x0

    const/4 v4, 0x0

    const/4 v5, 0x5

    invoke-direct {p0, v5}, Lrexsee/core/widget/Slider;->scale(I)I

    move-result v5

    const/4 v6, 0x0

    invoke-virtual {v2, v3, v4, v5, v6}, Landroid/widget/TextView;->setPadding(IIII)V

    .line 30
    iget-object v2, p0, Lrexsee/core/widget/Slider;->titleText:Landroid/widget/TextView;

    const/4 v3, -0x1

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextColor(I)V

    .line 31
    iget-object v2, p0, Lrexsee/core/widget/Slider;->titleText:Landroid/widget/TextView;

    invoke-static {p2}, Landroid/text/Html;->fromHtml(Ljava/lang/String;)Landroid/text/Spanned;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 32
    iget-object v2, p0, Lrexsee/core/widget/Slider;->titleText:Landroid/widget/TextView;

    new-instance v3, Landroid/widget/LinearLayout$LayoutParams;

    const/4 v4, -0x2

    const/4 v5, -0x2

    invoke-direct {v3, v4, v5}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    invoke-virtual {p0, v2, v3}, Lrexsee/core/widget/Slider;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 34
    :cond_0
    new-instance v0, Landroid/widget/LinearLayout;

    invoke-direct {v0, p1}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    .line 35
    .local v0, "sLayout":Landroid/widget/LinearLayout;
    const/4 v2, 0x1

    invoke-virtual {v0, v2}, Landroid/widget/LinearLayout;->setOrientation(I)V

    .line 36
    new-instance v1, Landroid/widget/LinearLayout;

    invoke-direct {v1, p1}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    .line 37
    .local v1, "textBar":Landroid/widget/LinearLayout;
    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Landroid/widget/LinearLayout;->setOrientation(I)V

    .line 38
    new-instance v2, Landroid/widget/TextView;

    invoke-direct {v2, p1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    iput-object v2, p0, Lrexsee/core/widget/Slider;->beginText:Landroid/widget/TextView;

    .line 39
    iget-object v2, p0, Lrexsee/core/widget/Slider;->beginText:Landroid/widget/TextView;

    const/4 v3, 0x3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setGravity(I)V

    .line 40
    iget-object v2, p0, Lrexsee/core/widget/Slider;->beginText:Landroid/widget/TextView;

    const/high16 v3, 0x41800000    # 16.0f

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextSize(F)V

    .line 41
    iget-object v2, p0, Lrexsee/core/widget/Slider;->beginText:Landroid/widget/TextView;

    const/4 v3, -0x1

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextColor(I)V

    .line 42
    iget-object v2, p0, Lrexsee/core/widget/Slider;->beginText:Landroid/widget/TextView;

    invoke-static {p3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 43
    iget-object v2, p0, Lrexsee/core/widget/Slider;->beginText:Landroid/widget/TextView;

    new-instance v3, Landroid/widget/LinearLayout$LayoutParams;

    const/16 v4, 0x3c

    invoke-direct {p0, v4}, Lrexsee/core/widget/Slider;->scale(I)I

    move-result v4

    const/16 v5, 0x18

    invoke-direct {p0, v5}, Lrexsee/core/widget/Slider;->scale(I)I

    move-result v5

    invoke-direct {v3, v4, v5}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v1, v2, v3}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 44
    new-instance v2, Landroid/widget/TextView;

    invoke-direct {v2, p1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    iput-object v2, p0, Lrexsee/core/widget/Slider;->seekText:Landroid/widget/TextView;

    .line 45
    iget-object v2, p0, Lrexsee/core/widget/Slider;->seekText:Landroid/widget/TextView;

    const/4 v3, 0x1

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setGravity(I)V

    .line 46
    iget-object v2, p0, Lrexsee/core/widget/Slider;->seekText:Landroid/widget/TextView;

    const/high16 v3, 0x41800000    # 16.0f

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextSize(F)V

    .line 47
    iget-object v2, p0, Lrexsee/core/widget/Slider;->seekText:Landroid/widget/TextView;

    const-string v3, "#F8E81D"

    invoke-static {v3}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I

    move-result v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextColor(I)V

    .line 48
    iget-object v2, p0, Lrexsee/core/widget/Slider;->seekText:Landroid/widget/TextView;

    invoke-static {p5}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 49
    iget-object v2, p0, Lrexsee/core/widget/Slider;->seekText:Landroid/widget/TextView;

    new-instance v3, Landroid/widget/LinearLayout$LayoutParams;

    const/4 v4, -0x1

    const/16 v5, 0x18

    invoke-direct {p0, v5}, Lrexsee/core/widget/Slider;->scale(I)I

    move-result v5

    const/high16 v6, 0x40000000    # 2.0f

    invoke-direct {v3, v4, v5, v6}, Landroid/widget/LinearLayout$LayoutParams;-><init>(IIF)V

    invoke-virtual {v1, v2, v3}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 50
    new-instance v2, Landroid/widget/TextView;

    invoke-direct {v2, p1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    iput-object v2, p0, Lrexsee/core/widget/Slider;->endText:Landroid/widget/TextView;

    .line 51
    iget-object v2, p0, Lrexsee/core/widget/Slider;->endText:Landroid/widget/TextView;

    const/4 v3, 0x5

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setGravity(I)V

    .line 52
    iget-object v2, p0, Lrexsee/core/widget/Slider;->endText:Landroid/widget/TextView;

    const/high16 v3, 0x41800000    # 16.0f

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextSize(F)V

    .line 53
    iget-object v2, p0, Lrexsee/core/widget/Slider;->endText:Landroid/widget/TextView;

    const/4 v3, -0x1

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextColor(I)V

    .line 54
    iget-object v2, p0, Lrexsee/core/widget/Slider;->endText:Landroid/widget/TextView;

    invoke-static {p4}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 55
    iget-object v2, p0, Lrexsee/core/widget/Slider;->endText:Landroid/widget/TextView;

    new-instance v3, Landroid/widget/LinearLayout$LayoutParams;

    const/16 v4, 0x3c

    invoke-direct {p0, v4}, Lrexsee/core/widget/Slider;->scale(I)I

    move-result v4

    const/16 v5, 0x18

    invoke-direct {p0, v5}, Lrexsee/core/widget/Slider;->scale(I)I

    move-result v5

    invoke-direct {v3, v4, v5}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v1, v2, v3}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 56
    new-instance v2, Landroid/widget/LinearLayout$LayoutParams;

    const/4 v3, -0x1

    const/4 v4, -0x2

    invoke-direct {v2, v3, v4}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v0, v1, v2}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 57
    new-instance v2, Landroid/widget/SeekBar;

    invoke-direct {v2, p1}, Landroid/widget/SeekBar;-><init>(Landroid/content/Context;)V

    iput-object v2, p0, Lrexsee/core/widget/Slider;->seekBar:Landroid/widget/SeekBar;

    .line 58
    iget-object v2, p0, Lrexsee/core/widget/Slider;->seekBar:Landroid/widget/SeekBar;

    sub-int v3, p5, p3

    mul-int/lit8 v3, v3, 0x64

    sub-int v4, p4, p3

    div-int/2addr v3, v4

    invoke-virtual {v2, v3}, Landroid/widget/SeekBar;->setProgress(I)V

    .line 59
    iget-object v2, p0, Lrexsee/core/widget/Slider;->seekBar:Landroid/widget/SeekBar;

    new-instance v3, Lrexsee/core/widget/Slider$1;

    invoke-direct {v3, p0, p3, p4, p6}, Lrexsee/core/widget/Slider$1;-><init>(Lrexsee/core/widget/Slider;IILrexsee/core/widget/Slider$OnSliderChangeListener;)V

    invoke-virtual {v2, v3}, Landroid/widget/SeekBar;->setOnSeekBarChangeListener(Landroid/widget/SeekBar$OnSeekBarChangeListener;)V

    .line 72
    iget-object v2, p0, Lrexsee/core/widget/Slider;->seekBar:Landroid/widget/SeekBar;

    new-instance v3, Landroid/widget/LinearLayout$LayoutParams;

    const/4 v4, -0x1

    const/4 v5, -0x2

    invoke-direct {v3, v4, v5}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v0, v2, v3}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 73
    new-instance v2, Landroid/widget/LinearLayout$LayoutParams;

    const/4 v3, -0x1

    const/4 v4, -0x2

    invoke-direct {v2, v3, v4}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    invoke-virtual {p0, v0, v2}, Lrexsee/core/widget/Slider;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 74
    return-void
.end method

.method static synthetic access$0(Lrexsee/core/widget/Slider;)Landroid/widget/TextView;
    .locals 1

    .prologue
    .line 15
    iget-object v0, p0, Lrexsee/core/widget/Slider;->seekText:Landroid/widget/TextView;

    return-object v0
.end method

.method private scale(I)I
    .locals 2
    .param p1, "pixel"    # I

    .prologue
    .line 19
    iget v0, p0, Lrexsee/core/widget/Slider;->mDensity:F

    int-to-float v1, p1

    mul-float/2addr v0, v1

    invoke-static {v0}, Ljava/lang/Math;->round(F)I

    move-result v0

    return v0
.end method


# virtual methods
.method public getValue()Ljava/lang/String;
    .locals 1

    .prologue
    .line 79
    iget-object v0, p0, Lrexsee/core/widget/Slider;->seekText:Landroid/widget/TextView;

    invoke-virtual {v0}, Landroid/widget/TextView;->getText()Ljava/lang/CharSequence;

    move-result-object v0

    invoke-interface {v0}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public setValue(I)V
    .locals 2
    .param p1, "value"    # I

    .prologue
    .line 82
    iget-object v0, p0, Lrexsee/core/widget/Slider;->seekText:Landroid/widget/TextView;

    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 83
    iget-object v0, p0, Lrexsee/core/widget/Slider;->seekBar:Landroid/widget/SeekBar;

    mul-int/lit8 v1, p1, 0x64

    div-int/lit16 v1, v1, 0xff

    invoke-virtual {v0, v1}, Landroid/widget/SeekBar;->setProgress(I)V

    .line 84
    return-void
.end method

.method public setValue(Ljava/lang/String;)V
    .locals 2
    .param p1, "value"    # Ljava/lang/String;

    .prologue
    .line 86
    iget-object v0, p0, Lrexsee/core/widget/Slider;->seekText:Landroid/widget/TextView;

    invoke-virtual {v0, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 87
    iget-object v0, p0, Lrexsee/core/widget/Slider;->seekBar:Landroid/widget/SeekBar;

    invoke-static {p1}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v1

    mul-int/lit8 v1, v1, 0x64

    div-int/lit16 v1, v1, 0xff

    invoke-virtual {v0, v1}, Landroid/widget/SeekBar;->setProgress(I)V

    .line 88
    return-void
.end method
